<%@ page import="org.example.atry.util.Users" %>
<%@ page import="java.util.List" %>
<%@ page import="org.example.atry.util.paga" %><%--
  Created by IntelliJ IDEA.
  User: wwzd1
  Date: 2024/12/25
  Time: 13:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        div{
            margin:0 auto;
            width: 550px;
        }
    </style>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<% //编写java代码，jsp与前端html的最大区别就是jsp能写java代码
    //通过request获取绑定的对象
    List<Users> usrs= (List<Users>) request.getAttribute("user");
    Integer paga= (Integer) request.getAttribute("current");
    Integer cs= (Integer) request.getAttribute("pagaSize");
    Integer tot= (Integer) request.getAttribute("totalpages");
%>
<div >
    <table class="table table-hover">
        <thead>
        <td>序号</td>
        <td>品种名称</td>
        <td>详细内容链接</td>
        </thead>
        <%for(Users c:usrs){ %>
        <tr>
            <!--"="代替了response.getwriter().println()，输出到页面，不用加分号-->
            <td class="info"><%= c.getId()%></td>
            <td class="warning"><%= c.getName()%></td>
            <td class="active"><a href="<%=c.getCharst()%>"><%=c.getCharst()%></a></td>
        </tr>
        <% }%>
        <tr> <td colspan="3"align="center"class="breadcrumb"><a href="serch.html">重新查询</a></td></tr>
    </table>
    <div class="btn-group btn-group-lg">
        <div align="center">
        <a href="pageallinfo?pageNum=1"class="btn btn-success ">首页</a>
        <a href="pageallinfo?pageNum=<%=paga-1%>"class="btn btn-success ">上一页</a>

        <a href="pageallinfo?pageNum=<%=paga+1%>"class="btn btn-success ">下一页</a>

        <a href="pageallinfo?pageNum=<%=tot%>"class="btn btn-success ">尾页</a>
        </div>

    </div>
    <div><div align="center"><span>共<%=tot%>页<span></span></span>当前第<%=paga%>页<span></span></div></div>
</div>
<script>
    $("thead").css("background","lightsteelblue")
</script>
</body>
</html>
